import request from '@/utils/request'

// 获取医生列表
export function getDoctorList(params) {
  return request({
    url: '/doctor/getAllDoctor',
    method: 'get',
    params
  })
}

// 获取医生详情
export function getDoctor(id) {
  return request({
    url: `/doctor/${id}`,
    method: 'get'
  })
}

// 新增医生
export function addDoctor(data) {
  return request({
    url: '/doctor',
    method: 'post',
    data
  })
}

// 修改医生
export function updateDoctor(data) {
  return request({
    url: '/doctor',
    method: 'put',
    data
  })
}

// 删除医生
export function deleteDoctor(id) {
  return request({
    url: `/doctor/${id}`,
    method: 'delete'
  })
}

// 医生认证
export function certificationDoctor(id, status) {
  return request({
    url: `/doctor/certification/${id}`,
    method: 'put',
    params: { status }
  })
}
